package wjw.mapper;

import com.wjw.mapper.RoadBasicTableMapper;
import com.wjw.model.Road_basic_table;
import com.wjw.utils.GetSqlSessionUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class RoadBasicTable {

    private SqlSession sqlsession= GetSqlSessionUtils.getSqlSession();
    private RoadBasicTableMapper mapper=sqlsession.getMapper(RoadBasicTableMapper.class);

    @Test
    public void test11(){
        System.out.println(mapper);
    }
    @Test
    public void test01(){
        List<Road_basic_table> all = mapper.findAll();
        System.out.println(all);
    }

    @Test
    public void test02(){
        Road_basic_table road_basic_table = new Road_basic_table();
        road_basic_table.setRoad_basic_name("名称2");
        road_basic_table.setRoad_basic_trend("走向1");
        road_basic_table.setRoad_basic_start("起点1");
        road_basic_table.setRoad_basic_end("终点1");
        road_basic_table.setRoad_basic_design("设计单位1");
        road_basic_table.setRoad_basic_made("施工单位1");
        road_basic_table.setRoad_basic_speed("设计时速1");
        road_basic_table.setRoad_basic_width("路幅宽度范围1");
        road_basic_table.setRoad_basic_length("道路长度1");
        road_basic_table.setRoad_basic_area("道路面积1");
        road_basic_table.setRoad_basic_AADT("平均日交通量1");
        road_basic_table.setRoad_basic_AADT_grade("交通量等级1");
        road_basic_table.setRoad_basic_town("所属乡镇1");
        road_basic_table.setRoad_basic_manager_type("管理分类1");
        road_basic_table.setRoad_basic_manager_unit("管理单位1");
        road_basic_table.setRoad_basic_look_unit("养护单位1");
        road_basic_table.setRoad_basic_build_date("建造年月1");
        road_basic_table.setRoad_basic_table_unit("制表单位1");
        road_basic_table.setRoad_basic_reviewer("审核人1");
        road_basic_table.setRoad_basic_lister("制表人1");
        road_basic_table.setRoad_basic_table_date("制表日期1");
        road_basic_table.setRoad_basic_condition("道路状态1");
        road_basic_table.setRoad_type_id(1);
        mapper.add(road_basic_table);
        sqlsession.commit();
    }

    @Test
    public void test03(){
        Road_basic_table road_basic_table = new Road_basic_table();
        road_basic_table.setRoad_basic_name("名称2");
        road_basic_table.setRoad_basic_trend("走向2");
        road_basic_table.setRoad_basic_start("起点2");
        road_basic_table.setRoad_basic_end("终点2");
        road_basic_table.setRoad_basic_design("设计单位2");
        road_basic_table.setRoad_basic_made("施工单位2");
        road_basic_table.setRoad_basic_speed("设计时速2");
        road_basic_table.setRoad_basic_width("路幅宽度范围2");
        road_basic_table.setRoad_basic_length("道路长度2");
        road_basic_table.setRoad_basic_area("道路面积2");
        road_basic_table.setRoad_basic_AADT("平均日交通量2");
        road_basic_table.setRoad_basic_AADT_grade("交通量等级2");
        road_basic_table.setRoad_basic_town("所属乡镇2");
        road_basic_table.setRoad_basic_manager_type("管理分类2");
        road_basic_table.setRoad_basic_manager_unit("管理单位2");
        road_basic_table.setRoad_basic_look_unit("养护单位2");
        road_basic_table.setRoad_basic_build_date("建造年月2");
        road_basic_table.setRoad_basic_table_unit("制表单位2");
        road_basic_table.setRoad_basic_reviewer("审核人2");
        road_basic_table.setRoad_basic_lister("制表人2");
        road_basic_table.setRoad_basic_table_date("制表日期2");
        road_basic_table.setRoad_basic_condition("道路状态2");
        road_basic_table.setRoad_type_id(1);
        road_basic_table.setRoad_basic_id(1);
        mapper.change(road_basic_table);
        sqlsession.commit();
    }
}
